package com.ztools.common.model.pc.coupon;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ztools.common.model.pc.BaseModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @Author: seeTools
 * @Date: 2023/5/11  15:36
 * @Version 1.0
 */
@Data
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("coupon_record")
public class CouponRecord extends BaseModel {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 券模板ID
     */
    private Long templateId;

    /**
     * 券名称
     */
    @TableField(exist = false)
    private String templateName;

    /**
     * 优惠券类型
     */
    @ExcelIgnore
    private Integer couponType;

    /**
     * 券类型名称
     */
    @TableField(exist = false)
    private String couponTypeName;

    /**
     * 会员ID
     */
    private Long memberId;

    @TableField(exist = false)
    private String memberPhone;

    /**
     * 会员名称
     */
    @TableField(exist = false)
    private String memberName;

    /**
     * 优惠券状态
     */
    @ExcelIgnore
    private Integer state;

    /**
     * 状态名称
     */
    @TableField(exist = false)
    private String stateName;

    /**
     * 开始时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date startDate;

    /**
     * 结束时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date endDate;

    /**
     * 发送时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date sendTime;

    /**
     * 使用时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date useTime;

    /**
     * 发送途径
     */
    @ExcelIgnore
    private String sendRoute;

    /**
     * 发送途径名称
     */
    @TableField(exist = false)
    private String sendRouteName;


    /**
     * 发券数量
     */
    @TableField(exist = false)
    @ExcelIgnore
    private Integer number;

    /**
     * 数量
     */
    @TableField(exist = false)
    @ExcelIgnore
    private String couponCount;

    /**
     * 满足金额
     */
    @JSONField(format = "#0.00")
    @TableField(exist = false)
    @ExcelIgnore
    private BigDecimal amountMeet;


    /**
     * 优惠金额
     */
    @JSONField(format = "#0.00")
    @TableField(exist = false)
    @ExcelIgnore
    private BigDecimal discountAmount;

    /**
     * 周几可用
     */
    @TableField(exist = false)
    @ExcelIgnore
    private String daysLimit;

    /**
     * 背景图片
     */
    @TableField(exist = false)
    @ExcelIgnore
    private String background;


    /**
     * 未使用
     */
    @TableField(exist = false)
    @ExcelIgnore
    private List<CouponRecord> usableList;

    /**
     * 已使用
     */
    @TableField(exist = false)
    @ExcelIgnore
    private List<CouponUsed> usedList;

    /**
     * 过期
     */
    @TableField(exist = false)
    @ExcelIgnore
    private List<CouponExpire> expireList;

    /**
     * 是否被选中
     */
    @TableField(exist = false)
    @ExcelIgnore
    private boolean check = false;
}
